package com.itheima.common;

import lombok.Data;

import java.util.List;

/*
 *@Parm
 *@ClassName Result
 *@Date 2022/1/9 22:32
 */
@Data
public class Result<T> {
    //总记录数
    private Long counts;

    //页大小
    private Integer pagesize;

    //总页数
    private Long pages;

    //当前页码
    private Integer page;

    //列表
    private List<T> items;


    public Result() {
    }

    public Result(Long counts, long pagesize, Long pages, long page, List items) {
        this.counts = counts;
        this.pagesize = Math.toIntExact(pagesize);
        this.pages = pages;
        this.page = Math.toIntExact(page);
        this.items = items;
    }


}
